<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/style.css" />
		<style>
			.guzh1{overflow: hidden;}
			.guzh1 button{display: block;float: left;width: 25%;margin: 9px;height: 0.6rem;color: #fff;border: none;border-radius: 0.3rem;padding: 0px!important;}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav ding-bar">
		    <div style="position: relative;">
				<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			 
			  
			</div>
		    
		</header>
		<div style="margin-top: 50px;">
		<!--下拉刷新容器-->
		    <div id="pullrefresh" class="newslist w620 mui-scroll-wrapper" style="position: static;">
				<!--数据列表-->
			    <div class="mui-scroll conferDiv" style="position: static;">
		<div class="mui-content" id="list">
		    <!--<div class="gongdan-con">-->
		    	<!--<ul class="gongdan-ul">
		    		<li><span>下单时间：</span><span>2019-05-12  21:05:30</span></li>
		    		<!--<li><span>超期时长：</span><span>14时25分36秒</span></li>-->
		    		<!--<li><span>已用时长：</span><span>1天14时25分36秒</span></li>-->
		    		<!--<li><span>电梯编号：</span><span>ASDFG123456</span></li>-->
		    		<!--<li><span>维保单号：</span><span>85214796365</span></li>-->
		    		<!--<li style="position: relative;"><span>电梯型号：</span><span>直梯</span><button class="chaoqi">超期</button><button class="jixiu">急修</button></li>-->
		    		<!--<li><span>电梯地址：</span><span>七里河区西湖雅筑小区(西津 东路南)梁家庄-13号楼</span></li>-->
		    	<!--</ul>-->
		    	<!--<div class="wbzt">-->
		    		<!--<div>-->
		    			<!--<span>确认状态：</span>-->
		    			<!--<span>待确认</span>-->
		    		<!--</div>-->
		    	<!--</div>-->
		    	<!--<div class="guzh">-->
	    			<!--<button class="gzx">确认完成</button>-->
	    			<!--<button class="dtx">电梯详情</button>-->
	    		<!--</div>-->
		    <!--</div>-->
		    <!--<div class="gongdan-con">-->
		    	<!--<ul class="gongdan-ul">-->
		    		<!--<li><span>下单时间：</span><span>2019-05-12  21:05:30</span></li>-->
		    		<!--<li><span>超期时长：</span><span>14时25分36秒</span></li>-->
		    		<!--<li><span>已用时长：</span><span>1天14时25分36秒</span></li>-->
		    		<!--<li><span>电梯编号：</span><span>ASDFG123456</span></li>-->
		    		<!--<li><span>维保单号：</span><span>85214796365</span></li>-->
		    		<!--<li style="position: relative;"><span>电梯型号：</span><span>直梯</span><button class="chaoqi">超期</button ><button class="jixiu">急修</button></li>-->
		    		<!--<li><span>电梯地址：</span><span>七里河区西湖雅筑小区(西津 东路南)梁家庄-13号楼</span></li>-->
		    	<!--</ul>-->
		    	<!--<div class="wbzt">-->
		    		<!--<div>-->
		    			<!--<span>确认状态：</span>-->
		    			<!--<span>已确认</span>-->
		    		<!--</div>-->
		    	<!--</div>-->
		    	<!--<div class="guzh">-->
	    			<!--<button class="gzx">确认完成</button>-->
	    			<!--<button class="dtx">电梯详情</button>-->
	    		<!--</div>-->
		    <!--</div>-->
		</div>
		</div>
		</div>
		</div>
		<script src="../js/jquery-1.8.0.min.js"></script>
		<script src="../js/mui.min.js"></script>
		<script type="text/javascript" src="../js/head_public.js" ></script>
		<script type="text/javascript" src="../js/common.js" ></script>
		<script type="text/javascript" src="../js/session.js" ></script>
			<script type="text/javascript">
			mui.init()
			mui("#list").on("tap",".gzx",function(){
				mui.openWindow({url:$(this).attr("data-href")})
			})
			mui("#list").on("tap",".dtx",function(){
				mui.openWindow({url:$(this).attr("data-href")})
			})
		</script>
		<script type="text/javascript">
			
			mui.init()
			var work_id=getCookie("workid");
             var work=getCookie("work");
             var userid=getCookie("userid");
            var page=1;	
			var $height = $(window).height();
			var $height1 = $("header").height();
			$(".mui-scroll-wrapper").height( $height - $height1 +100);
			
			mui.init({
				pullRefresh: {

					container: '#pullrefresh',
					down: {
						style:'circle',
						callback: pulldownRefresh
					},
					up: {
						contentrefresh: '正在加载...',
						callback: pullupRefresh
					}
				}
			});
				/**
			 * 下拉刷新具体业务实现
			 */
			function pulldownRefresh() {
				setTimeout(function() {
					mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
					location.reload();
				}, 1500);
			}
			/**
			 * 上拉加载具体业务实现
			 */
			function pullupRefresh() {
				setTimeout(function() {
					mui('#pullrefresh').pullRefresh().endPullupToRefresh(); //参数为true代表没有更多数据了。
					getContents();
				}, 1500);
			}
		
           
             if(userid==""||userid==null){
             	alert("您还没有登录，请先登录")
             	location.href="../public/login.html";
             }else{
             	if(work!="1"){
					alert("您不是管理员,您没有权限")
					mui.openWindow({url:"../public/index.html"})
				}
             	
             }
             function getContents(){
             	var param={};
             	param.work_id=work_id;
             	param.member_id=userid;
             	param.member_work=work; 
             	param.page=page; 
                var dai=getQueryString("dai");
                if(dai=="dai"){
                	param.status="2";
                	$(".ding-bar").append('<h1 class="mui-title">待确认工单</h1>')
                	param.check="1"; //待确认
                }else if(dai=="wei"){
                	$(".ding-bar").append('<h1 class="mui-title">已确认工单</h1>')
                	param.status="2";
                	param.check="2"; //已确认
                }
             	$.post(net+"/public/index.php?s=api/elevator/elevator_buglist/",param,function(res){
             	   if(res.code=="200"){
             	   	  if(res.result!=null&&res.result.length!=0){
             	   	  	var str="";
             	   	  	 $.each(res.result,function(index,val){
             	   	  	 	var queren="";//存放确认状态
             	   	  	 	var btn="";//存放下面的按钮
             	   	  	 	if(this.check=="1"&&this.status=="2"){
             	   	  	 		queren="待确认";
             	   	  	 		btn= '<button class="gzx" data-href="qr_finish.html?id='+this.id+'" style="background:#ff7e00">完成确认</button><button class="gzx" data-href="besause.html?id='+this.id+'">故障详情</button><button class="dtx"  data-href="xiangqing.html?id='+this.eid+'">电梯详情</button></div></div>'
             	   	  	 	}else if(this.check=="-1"&&this.status=="2"){
             	   	  	 		queren="驳回";
             	   	  	 		btn= '<button class="gzx" data-href="bh_course.html?id='+this.id+'" style="background:#ff7e00">驳回原因</button><button class="gzx" data-href="besause.html?id='+this.id+'">故障详情</button><button class="dtx"  data-href="xiangqing.html?id='+this.eid+'">电梯详情</button></div></div>'
             	   	  	 	}else if(this.check=="2"&&this.status=="2"){
             	   	  	 		queren="已确认";
             	   	  	 		btn= '<button class="gzx" data-href="besause.html?id='+this.id+'">故障详情</button><button class="dtx"  data-href="xiangqing.html?id='+this.eid+'">电梯详情</button></div></div>'
             	   	  	 	}
             	   	  	 	str+='<div class="gongdan-con"><ul class="gongdan-ul"><li><span>下单时间：</span><span>'+this.addtime+'</span></li>'
		    	               +'<li><span>电梯编号：</span><span>'+this.elevator_code+'</span></li><li><span>维保单号：</span><span>'+this.number+'</span></li>'
		    		           +'<li style="position: relative;"><span>电梯型号：</span><span>'+this.type+'</span></li>'
		    		           +'<li><span>电梯地址：</span><span>'+this.address+'</span></li></ul><div class="wbzt"><div><span>确认状态：</span><span>'+queren+'</span></div></div>'
		    		           +'<div class="guzh1">'
		    		           +btn;
             	   	  	 })
             	   	  	 $("#list").append(str)
             	   	  	 page++;
             	   	  }else{
             	   	  	mui.toast("您还没有该工单")
             	   	  }
             	   }
             	})
             }
             getContents();
		</script>
	</body>

</html>